﻿using System;
using DeepEarth.Map.Core;
using DeepEarth.Map.Core.Tiling;

namespace DeepEarth.Map.TileSources
{
	/// <summary>
	/// A map mode describes a set of tiles and their opacity. It is used with the MapView Mode and SecondaryModes properties.
	/// </summary>
	public class MapServerTileSourceProvider : BaseTileSourceProvider<MapServerTileSourceFactory>
	{
		public MapServerTileSourceProvider()
			: this(MapServerTileSourceFactory.GoogleMap)
		{
		}

        protected MapServerTileSourceProvider(MapMode mode)
			:base(mode)
		{
			var tileSource = TileSourceFactory.CreateTileSource(Mode);
			if (tileSource != null)
				TileSourcesCollection.Add(tileSource);
		}

		public override BaseTileSourceProvider Clone()
		{
			var result = new MapServerTileSourceProvider();
            FillClone(result);
            return result;
        }
	}
}